﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>用户注册</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <!--link-->
    <link type="text/css" rel="stylesheet" href="css/style.css" />
    <link type="text/css" rel="stylesheet" href="css/register.css" />
    <!--js-->
    <script src="js/jquery.min.js"></script>
    <script src="js/register.js"></script>
    <style>
        .discoloration {
            color: #ed7e17;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="main">           
            <form class="form_content">
                <span style="float:right;font-size:40px;margin-right:2%;">×</span>
                <div class="form_content_top">
                    <span style="font-size:20px;">用户注册</span>
                    <p>个人用户注册</p>
                    <p>管理员注册</p>
                </div>     
                <div class="form_content_in">
                    <ul>
                        <li class="form_li"><img src="img/nuit.png" /><input name="address" type="text" placeholder="工作单位" /></li>
                        <li class="form_li"><img src="img/icon_one.png" /><input name="nickname" type="text" placeholder="请输入姓名" /></li>
                        <li class="form_li_one">
                            
                            <div class="form_age">
                                <img src="img/age.png" />
                                <input placeholder="请输入年龄" type="text" style="width: 46%;" />
                            </div>
                            <div class="form_sex">
                                <span><input type="radio" name="sex" checked="checked">男</span>
                                <span><input type="radio" name="sex">女</span>
                            </div>
                        </li>      
           
                          
                        <li class="form_li"><img src="img/phone.png" /><input name="phone" type="text" placeholder="账号/手机号" /></li>
                        <li class="form_li"><img src="img/icon_two.png" /><input name="loginpwd" type="text" placeholder="请输入密码" /></li>
                        <li class="form_li"><img src="img/icon_two.png" /><input name="loginpwdtwo" type="text" placeholder="**********" /></li>
                    </ul>
                </div>             
                <div class="form_content_bottom">
                    <button class="btn_register">立即注册</button>
                    <br/>
                    <a href="" class="go_login">已有账号?去登录</a>
                </div>
            </form>
        </div>
    </div>
</body>
<script>
    $(function () {
        if($(".loginpwd").val().equals($(".loginpwdtwo").val())){
            return true;
        }else {
            return false;
        }
        let manage = {
            "address": $(".address").val(),
            "nickname": $(".nickname").val(),
            "sex": $(".sex").val(),
            "phone": $(".phone").val(),
            "loginpwd": $(".loginpwd").val(),
        }
        $.ajax({
            url:"/sys/manage/register",
            type:"POST",
            data:JSON.stringify(manage),
            datatype:"json",
            success:function (data) {
                let parse = JSON.parse(data);
                if(data.flag==="success"){
                    alert("添加成功");
                }else {
                    alert("添加失败");
                }
            }
        })
    })
</script>
</html>